
var stacks = '';//require('../index.js');
/*
stacks.listen(3000, onStartedListening, onNewClientConnected);

function onStartedListening() {
	  //debug('stacks listening');
	  console.log('listening on port: '+3000);
	}


function onNewClientConnected(clientKey) {
	
	console.log('Client ['+clientKey+'] connected successfully');
	setTimeout(function() {
		var msg = 'hello';//{header:'this is the header', body:'this is the body'};
		for (var i = 1; i <= 5; i++) {
			console.log('sending msg-'+i+'...');
			stacks.request('MSG', msg, onMsgRespRcvd);
		}
		var jobj = {header:'this is the header', body:'this is the body'};
		for (var i = 1; i <= 5; i++) {
			console.log('sending event-'+i+'...');
			stacks.request('EVENT', jobj, onEventRespRcvd);
		}

	}, 2000);
}
function onMsgRespRcvd (error, data, clientKey) {
    if (error) {
      console.error('error: ', error);
      return;
    }

    console.log('Rcvd MSG From Client['+clientKey+']: length['+data.length+'] ', data);
}
function onEventRespRcvd (error, data, clientKey) {
    if (error) {
      console.error('error: ', error);
      return;
    }

    console.log('Rcvd EVENT From Client['+clientKey+']: ', data);
}
*/